package com.bytezreo.objectclass2;



public class Circle extends GeometricObject {
	
	private double radius;
	
	public Circle()
	{
		super();
		radius = 1.0;
		
//		color = "while";
//		weight = 1.0;
		
	}

	public Circle(double radius) {
		super();
		this.radius = radius;
	}
	
	
	public Circle(double radius,String  color,double weight) {
		super(color,weight);
		this.radius = radius;
	}

	public double getRadius() {
		return radius;
	}

	public void setRadius(double radius) {
		this.radius = radius;
	}
	
	//求圆的面积
	public double findAre() {
		return 3.14* radius *radius;
	}
	
	//比较半径是否相等
	@Override
	public boolean equals(Object obj) {
		
		if(this == obj) {
			return true;
		}
		
		if(obj instanceof Circle) {
			Circle c1 = (Circle)obj;
			return this.radius == c1.getRadius();
		}
		
		return false;
		
	}

	@Override
	public String toString() {
		return "Cirlcle [radius=" + radius + "]";
	}

	
	
}
































